package org.SimpleSpringBoot.user;

import org.SimpleSpringBoot.annotation.Autowired;
import org.SimpleSpringBoot.annotation.Service;

/**
        * 用户服务层
        */
@Service
public class UserService {


    @Autowired
    private UserRepository userRepository;

    /**
     * 获取用户信息
     */
    public String getUser(String name) {
        return userRepository.findUser(name);
    }

    /**
     * 获取用户列表
     */
    public String getUserList() {
        return userRepository.getAllUsers();
    }

    /**
     * 处理用户业务逻辑
     */
    public String processUser(String name) {
        String userInfo = getUser(name);
        return "处理结果: " + userInfo + " [已处理]";
    }
}